package org.shanktech.tshare.binlogsync.model.binlog;

import java.util.List;

import org.shanktech.tshare.binlogsync.process.BinlogdataParser;
import org.shanktech.tshare.binlogsync.process.TableTransfer;
import org.shanktech.tshare.binlogsync.util.Constant.BinlogFormat;

import com.google.code.or.common.glossary.Column;

public abstract class BinlogData {

  private List<Column> columnList;

  private String databaseName;

  private String tableName;

  private TableTransfer transfer;

  private BinlogdataParser binlogdataParser;

  private BinlogFormat binlogFormat;

  private String sql;

  public abstract String getType();

  public BinlogData(List<Column> columnList, String databaseName,
      String tableName, TableTransfer transfer,
      BinlogdataParser binlogdataParser, BinlogFormat binlogFormat,
      String sql) {
    super();
    this.columnList = columnList;
    this.databaseName = databaseName;
    this.tableName = tableName;
    this.transfer = transfer;
    this.binlogdataParser = binlogdataParser;
    this.binlogFormat = binlogFormat;
    this.sql = sql;
  }

  public String getDatabaseName() {
    return databaseName;
  }

  public void setDatabaseName(String databaseName) {
    this.databaseName = databaseName;
  }

  public String getTableName() {
    return tableName;
  }

  public void setTableName(String tableName) {
    this.tableName = tableName;
  }

  public TableTransfer getTransfer() {
    return transfer;
  }

  public void setTransfer(TableTransfer transfer) {
    this.transfer = transfer;
  }

  public BinlogFormat getBinlogFormat() {
    return binlogFormat;
  }

  public void setBinlogFormat(BinlogFormat binlogFormat) {
    this.binlogFormat = binlogFormat;
  }

  public String getSql() {
    return sql;
  }

  public void setSql(String sql) {
    this.sql = sql;
  }

  @Override
  public String toString() {
    return "BinlogData [databaseName=" + databaseName + ", tableName="
        + tableName + ", transfer=" + transfer + ", binlogFormat="
        + binlogFormat + ", sql=" + sql + "]";
  }

  public BinlogdataParser getBinlogdataParser() {
    return binlogdataParser;
  }

  public void setBinlogdataParser(BinlogdataParser binlogdataParser) {
    this.binlogdataParser = binlogdataParser;
  }

  public List<Column> getColumnList() {
    return columnList;
  }

  public void setColumnList(List<Column> columnList) {
    this.columnList = columnList;
  }
}
